added file to contain common functions
added logout function to functions