Add face detection logic(need refactoring)