fix end method