Added login check after startup + cleanup