fixed checkIfNull issue