Fixed issue with back key not working correctly