fix logout problem and add commonDirectives