Fixted storing to database so select works properly