fixes + local middleware