added fetching from database
merged changes