fixed warning from handling filename improperly