Fixing define function