Added more security checks to the content controller