Bug fix: check ptr address! --kazu