remove trailing spaces
fix onShow callback