added error check at complie time