added null check for strings recieved