slightly better error (tho theres room for improvement) and unit testing for it