avatar spawn logic