added a version check before setting layer type.