fixed misc bug