added handling in the case of null protocol
version 0.5.1