fixed some db staff, and args passing