bugfix and debug added