closedir(): Argument #1 ($dir_handle) must be of type resource or null, bool given