bind viewmodel at the end of the constructor to prevent errors

resolves #394