added db check as test

remember to remove require and function call