fix missing variable, callback and typo issues