finish the application