fixed possible null deref