fix php error notices and date formatting, refresh history after storing new code