if statment issue on ext script