Added logout wait