fixed some bugs handling this and outer