allow view to be `null` in ajax context