Moved Thread.sleep to original place and changed stacktrace to logger