fixing functionality in modal view controllers