fixed typo and added a little more debugging