Solved some issues with files and databases