add check for null received