update translate function
fix pointer