Use model constructor instead of global var