On my machine the redirection to twitter did not work. When I added die after the header location it worked.