Update parse argument function to handle javascript object