check magic and get version