God damn it
Fixed error handling