fixing bug in require directory where exception is not found