Updated indexfile to work for all db type