fixed bug in test and create dblink