Replace perspective call with local variable