Fixing showing success state before doing work