init function taken out of viewstate bindings