going into database correctly