Fixed issue with dictionary key being called when not existent