return error if it occurs