Revert and restored key functions

To fix issues