transformed all queries to new query, added cookies to login