brought back the phase end function