replace Rails try method for redis key storage