add console log and fix toLowerCase bug