fixing potential NPE
 cleanup