Add Q promises, fix throw error issue