ensuring only plain objects are used on callbacks