some database search but inelegant. connections not working?