adding few checks on the response