better type checking
fixed default db path