Fix bug of trim

Change-Id: Ifae846a996b9c824c2abf4e4cf9506a3b15af2f3
Signed-off-by: Chloe Xu <chloe.xu@sap.com>