Properly stop handle when pub stops