Error in debugging code