added account nullpointer check