- fix undefined error

- add delete action to query