clear beginning and ending keys