removed null pointer bug