STACK implemented buggy