bugfix of delete .r file (wrong code)