correctly remove characters for filename