Reverted to Smarty original code