fixed potential null pointer
formatting