add reload function to prevent blank page