Fixed typo, added debugging logs