Fixed sleep time
Added support to run in a server in background