Add logic for checking the null