did not work in production mode
updated version