updated filename error handling