correctly set error argument