Merge pull request #55 from ronnywang/fix_typo

fix typo
preUpdate has optional argument
check array_key_exists to avoid notice