fixed self-calling function