added logout function, photo required

fixed #22
fixed #23