replaced ugly and not working hack with simple and (hopefully) working hack