proper casting of dictionary