Fixed typo and added debug log