fixed some exception handling, rewrote pausableThread