stack error
rewritten to inner function
works ones
error in call fixed, but still no work