some fixing in debug... still doesn't work
now debug works