handling a NPE
adding few debug logs and sorting a toString method