made smarty global
added smarty code