adds to database correctly