Fixed bug on detecting faces