fixed bug in apply method in permissions causing empty results to be sent