added getReadMessages and getMessage to database