Fixed Error in null check