fixed rbm to make model a global var