fixed no-so-graceful bug