fix bug in unregister_from_filename()