bug fixes; added logout