fix some weird bugs...