swapping back the order of error in function call