added error handling for if GL context returns null