Fixing js error

Found error when running with jQuery ajax form plugin.