fix function reference for old browsers