static variable problem solved