Added magic check.

Added magic check.