define serializeHash function to fix array params