Preventing grails exception