add check for returning type