move the versions filename ('files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)) to a var and use that also in the following lines