delete log
add null check