fixed create accessor function