set error msg to varaible instead of print