fixed wrong behaviour with phases