Check if job was finished successfully

Fixed #6