added func to create phases on demand