Hacky fix to task switch issue