raises an error if stack is empty and trying to pop