private boolean addFriendMessage(AddFriendMessage message, Connection sourceConnection) {
    AddFriendResponseMessage response;
    try {
      UserRecord user = databaseOperations.getUserRecord(message.getTargetUsername());
      if (user == null) { // user doens't exist
        response = new AddFriendResponseMessage(false, USER_DOESNT_EXIST);
      }
      else {
        databaseOperations.addFriendRequest(message.getSourceUsername(), message.getTargetUsername());
        response = new AddFriendResponseMessage(true, FRIEND_REQUST_SENT);
        User targetUser = userManager.getUserByUsername(message.getTargetUsername());
        if (targetUser != null) { // send friend request if target user is online
          FriendRequest request = new FriendRequest(message.getSourceUsername(), message.getSourceName(),
              targetUser.getUsername());
          FriendRequestMessage requestMessage = new FriendRequestMessage(request);
          writeResponse(requestMessage, targetUser.getConnection());
        }
      }
      writeResponse(response, sourceConnection);
    }
    catch (SQLException e) {
      response = new AddFriendResponseMessage(false, OPERATION_FAILED);
      writeResponse(response, sourceConnection);
      return false;
    }
    return true;
  }