Fix excessive query in actions.js