Bugfix to phases

* bugfix: fixing phases implementation