debugging null pointer error