merged so it works on both platforms