Fix update action
Add json for rule with 'update' action
fix query using same entity other scripts