added handling in the case of null protocol