fixed to call recursively