added logout fixes for rails 4