fix bug with read database selection