Added listener for error