change return value for different error type