fixing an unnecessary runtime exception