added functionality to fs_close