avoided null pointer
removed unnecessary break