changed if-statement to check HXP.renderMode