add accessing function to stack