BUGFIX: http://pastebin.com/5AHz0TAu thanks to mprivozn