Changed to a function