fixed for compatibility with perl <= 5.12