Changed it as a function