fixed bug in stack