fix bugs of multiple arguments for apply