Adjusted get_controller method to account for parent controller directories