clean up filename handling