updated code for 3.3.1