Added logging and typo fix