rename parameters and fix bug