fix some bugs in FOOTPRINT_VIEWER_FRAME, get rid of statics