fighting null pointers and giving better fail cases
backwards compatible SDK version