changed a array null check for 0 check