Made region system work with pure js (and new native api)