added functionality to debug