Fixed the error handling in the content selector