added guard in case data received is nil