Fix thread interrupt handling instead of returning null