fixing nasty Bugs