fixing var type to match return from function