Updated to support older java versions