Added version check logic