added refresh function