fix bugs, still have a warning