fixed recursive function