Switch around to make deferreds work