Fixed IllegalMonitorStateException.
bug fixes