Added logout code