bug fix: extra null check