fixed the returning type errors