refresh functionality used -still needs corrections