fixed the confine and float bug