fixed the issue with runtime exception