Corrected bug with current key