make status a local var in all functions
throw -> error for better formatting