Doing some checks for null