move maincontroller onload bindings to controller