improve stackApplication in database