fix frame pointer validation code