Added guards to work in Linux