minor edits to main frame js code