implemented delete and logout function