adding loop in transitions