working on database: added quera function and insert session
fix