im currently using this and it seems to work just fine.

http://pastebin.com/qGMg0kax