trim all the values to fit into the database