fixed the bug in null functionality