Trying to update database correctly