added logout handler