grid option was not working in some cases