fix error handling in Threads controller