Added function to strip trailing space on getkey and delkey