debug and fix