add changes on non-working branch master to make it work