Add beforeParams callback.