some big fixes