Revert "static mode bug fix"

This reverts commit 25306ca529c98a4f80d3d1e2e618085b78a1ae26.
Revert "check write remove"

This reverts commit f7edfa3b8c1bdcfdddc3170b34b094652af6f722.
intersect/within bugfix
static mode bugfix