Update main.js

Handle case were edit might be first url parameter.