removing function from state