fixes

-added niklas' magic code