fix median function in app.py, generate random data in record_data.py