debug and some fixes