fixed unhandled NullPointerException occurrence