Add return code for extract function