Fixed remote callback to trigger only after ajax is complete