fixed bug in determining latest version