Added query to release method

Hi, I've added the option to specify a custom query to release a bunch of hosts (actually the option was there, but it wasn't being used).