added  checks!

null pointer exception