fix bugs and add file storage