cleanup
add null check