Fixing a bug in getContext