fix bug with val function