fixed bug in viewModel creation in select statement