Fix organization middleware