Finish the logic of file back