prevent out of bounds access
robustify load functions