fixed selecting database