checking for null termination