fixing some queries  + logout link