bug fix for stack pointer