improved debugging a bit