Properly inserts info to database