check magic numbers properly