debugging null pointer exception