Revised also preview to remove bugs and add missing code Change-Id: I895a4c6f15e8875685930e173eb242888c73dac7