fix some stupid bugs