debugging fixes