updated to work with grails 2