Fixed bug when storing files info to db