fixes for opening correct files