add debug print
update database name
add dbname parsing
fix dbname parsing bug
added checksession