Improved coding on version check