fixed issues when running on Mono