Updated database shared data and fixed bug in database query