Changed script to work correctly with CentOS 7.0