repaired deprecated functions. Thanks Google