changing the static variable to non static variable
fixed memory issues
memory improvements