Added more logic for id checking