added some functions to viewmodel