debugging mode + minor fix