Fix error callback in function first