logout feature now working with security measures in place