tried to fix the problem with stopping the webserver.
code refactoring; fixed problem with calculating process runtime.