add safe static middleware