fixed nosub function