added refresh function and settings page