new parsing function to avoid one potential bug