Cause of nullPointerException removed