moved database save code to execute when input is correct