restoring ruby code to ensure dynamic changes are reflected properly