fixing debugging code