rewritten, missning instance duplicate function