update $.when() to make it supports array as the first argument.