changed the filename handling