when is a defendant entitled to have bail returned
may be returned at the end of the trial , if all court appearances are made , regardless of whether the person is found guilty or not guilty of the crime accused .