Added logout funcitonality into view