Added code to replace To header dynamically