improved debugging