fix check on null