loading dialog leaking fix