Added additional logic to prepareParameters()