fixed Some bugs