changed delteMessage method to deleteMessages